package org.bronycorps.mlptss.domain.model.type;

public enum EnemyColor {
	BLUE("blue", 4), BROWN("brown", 3), MAGENTA("magenta", 5), PINK("pink", 1), YELLOW(
			"yellow", 2);

	public static EnemyColor getColorByLevel(int level) {
		for (EnemyColor color : EnemyColor.values()) {
			if (level == color.level) {
				return color;
			}
		}
		return null;
	}

	public static EnemyColor getNextColor(EnemyColor current, int damage) {
		final int level = current.level - damage;
		for (EnemyColor color : EnemyColor.values()) {
			if (level == color.level) {
				return color;
			}
		}
		return null;
	}

	public int level;

	public String suffix;

	private EnemyColor(String name, int ordinal) {
		this.suffix = name;
		this.level = ordinal;
	}

}
